<?php

abstract class Model
{
	private $oErrors;
	private $oActionMessage;
	
	public function __construct()
	{
		$this->oErrors = array();
		$this->oActionMessage = null;	
	}
	
	protected function addError($error, $msg)
	{
		$this->oErrors[$error] = $msg;
	}
	
	public function errors() { return $this->oErrors; }
	
	public function hasError() { return !empty($this->oErrors); }
	
	public function hasMsg() { return !is_null($this->oActionMessage); }
	
	protected function setMsg($msg) { return $this->oActionMessage = $msg; }
	public function msg() { return $this->oActionMessage; }
	
}

?>